<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>eccodes: Iterating on latitude/longitude/values</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">eccodes
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>C&#160;Interface</span></a></li>
      <li><a href="classeccodes.html"><span>F90&#160;Interface</span></a></li>
      <li><a href="namespaces.html"><span>Python&#160;Interface</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Iterating on latitude/longitude/values</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcodes__iterator.html">codes_iterator</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcodes__nearest.html">codes_nearest</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga250295a1b927401bcb1e03aac032396c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcodes__iterator.html">codes_iterator</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__iterators.html#ga250295a1b927401bcb1e03aac032396c">codes_grib_iterator_new</a> (<a class="el" href="structcodes__handle.html">codes_handle</a> *h, unsigned long flags, int *error)</td></tr>
<tr class="memdesc:ga250295a1b927401bcb1e03aac032396c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new iterator from a GRIB handle, using current geometry and values.  <a href="#ga250295a1b927401bcb1e03aac032396c">More...</a><br/></td></tr>
<tr class="separator:ga250295a1b927401bcb1e03aac032396c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9d8fdb87efce9d49ac54853ee5871e01"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__iterators.html#ga9d8fdb87efce9d49ac54853ee5871e01">codes_grib_get_data</a> (<a class="el" href="structcodes__handle.html">codes_handle</a> *h, double *lats, double *lons, double *values)</td></tr>
<tr class="memdesc:ga9d8fdb87efce9d49ac54853ee5871e01"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get latitude/longitude and data values.  <a href="#ga9d8fdb87efce9d49ac54853ee5871e01">More...</a><br/></td></tr>
<tr class="separator:ga9d8fdb87efce9d49ac54853ee5871e01"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9bc83fc66d5f39ecf123d3c3e5b1fecf"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__iterators.html#ga9bc83fc66d5f39ecf123d3c3e5b1fecf">codes_grib_iterator_next</a> (<a class="el" href="structcodes__iterator.html">codes_iterator</a> *i, double *lat, double *lon, double *value)</td></tr>
<tr class="memdesc:ga9bc83fc66d5f39ecf123d3c3e5b1fecf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the next value from an iterator.  <a href="#ga9bc83fc66d5f39ecf123d3c3e5b1fecf">More...</a><br/></td></tr>
<tr class="separator:ga9bc83fc66d5f39ecf123d3c3e5b1fecf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga93ef62613c251baa5ada3924d3c856ac"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__iterators.html#ga93ef62613c251baa5ada3924d3c856ac">codes_grib_iterator_previous</a> (<a class="el" href="structcodes__iterator.html">codes_iterator</a> *i, double *lat, double *lon, double *value)</td></tr>
<tr class="memdesc:ga93ef62613c251baa5ada3924d3c856ac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the previous value from an iterator.  <a href="#ga93ef62613c251baa5ada3924d3c856ac">More...</a><br/></td></tr>
<tr class="separator:ga93ef62613c251baa5ada3924d3c856ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga97dfa89fe0ebed41b238d98bac36db8a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__iterators.html#ga97dfa89fe0ebed41b238d98bac36db8a">codes_grib_iterator_has_next</a> (<a class="el" href="structcodes__iterator.html">codes_iterator</a> *i)</td></tr>
<tr class="memdesc:ga97dfa89fe0ebed41b238d98bac36db8a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test procedure for values in an iterator.  <a href="#ga97dfa89fe0ebed41b238d98bac36db8a">More...</a><br/></td></tr>
<tr class="separator:ga97dfa89fe0ebed41b238d98bac36db8a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga635320df5854ae08367fed2e5f895e2b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__iterators.html#ga635320df5854ae08367fed2e5f895e2b">codes_grib_iterator_reset</a> (<a class="el" href="structcodes__iterator.html">codes_iterator</a> *i)</td></tr>
<tr class="memdesc:ga635320df5854ae08367fed2e5f895e2b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test procedure for values in an iterator.  <a href="#ga635320df5854ae08367fed2e5f895e2b">More...</a><br/></td></tr>
<tr class="separator:ga635320df5854ae08367fed2e5f895e2b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3999693d3932a62eada0d1de5b594d2f"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__iterators.html#ga3999693d3932a62eada0d1de5b594d2f">codes_grib_iterator_delete</a> (<a class="el" href="structcodes__iterator.html">codes_iterator</a> *i)</td></tr>
<tr class="memdesc:ga3999693d3932a62eada0d1de5b594d2f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Frees an iterator from memory.  <a href="#ga3999693d3932a62eada0d1de5b594d2f">More...</a><br/></td></tr>
<tr class="separator:ga3999693d3932a62eada0d1de5b594d2f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga201d49e6c835f3b6ed041147d0bf4898"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcodes__nearest.html">codes_nearest</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__iterators.html#ga201d49e6c835f3b6ed041147d0bf4898">codes_grib_nearest_new</a> (<a class="el" href="structcodes__handle.html">codes_handle</a> *h, int *error)</td></tr>
<tr class="memdesc:ga201d49e6c835f3b6ed041147d0bf4898"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new nearest from a handle, using current geometry .  <a href="#ga201d49e6c835f3b6ed041147d0bf4898">More...</a><br/></td></tr>
<tr class="separator:ga201d49e6c835f3b6ed041147d0bf4898"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8c53c53033259beaf32055154f193a83"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__iterators.html#ga8c53c53033259beaf32055154f193a83">codes_grib_nearest_find</a> (<a class="el" href="structcodes__nearest.html">codes_nearest</a> *nearest, <a class="el" href="structcodes__handle.html">codes_handle</a> *h, double inlat, double inlon, unsigned long flags, double *outlats, double *outlons, double *values, double *distances, int *indexes, size_t *len)</td></tr>
<tr class="memdesc:ga8c53c53033259beaf32055154f193a83"><td class="mdescLeft">&#160;</td><td class="mdescRight">Find the 4 nearest points of a latitude longitude point.  <a href="#ga8c53c53033259beaf32055154f193a83">More...</a><br/></td></tr>
<tr class="separator:ga8c53c53033259beaf32055154f193a83"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8c3b2ed99693a097211000552876a61d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__iterators.html#ga8c3b2ed99693a097211000552876a61d">codes_grib_nearest_delete</a> (<a class="el" href="structcodes__nearest.html">codes_nearest</a> *nearest)</td></tr>
<tr class="memdesc:ga8c3b2ed99693a097211000552876a61d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Frees an nearest from memory.  <a href="#ga8c3b2ed99693a097211000552876a61d">More...</a><br/></td></tr>
<tr class="separator:ga8c3b2ed99693a097211000552876a61d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6338ab9e3fb68c25d4fe48a8467cdbfc"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__iterators.html#ga6338ab9e3fb68c25d4fe48a8467cdbfc">codes_grib_nearest_find_multiple</a> (<a class="el" href="structcodes__handle.html">codes_handle</a> *h, int is_lsm, double *inlats, double *inlons, long npoints, double *outlats, double *outlons, double *values, double *distances, int *indexes)</td></tr>
<tr class="memdesc:ga6338ab9e3fb68c25d4fe48a8467cdbfc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Find the nearest point of a set of points whose latitudes and longitudes are given in the inlats, inlons arrays respectively.  <a href="#ga6338ab9e3fb68c25d4fe48a8467cdbfc">More...</a><br/></td></tr>
<tr class="separator:ga6338ab9e3fb68c25d4fe48a8467cdbfc"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga9d8fdb87efce9d49ac54853ee5871e01"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int codes_grib_get_data </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcodes__handle.html">codes_handle</a> *&#160;</td>
          <td class="paramname"><em>h</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>lats</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>lons</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>values</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get latitude/longitude and data values. </p>
<p>The Latitudes, longitudes and values arrays must be properly allocated by the caller. Their required dimension can be obtained by getting the value of the integer key "numberOfPoints".</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">h</td><td>: handle from which geography and data values are taken </td></tr>
    <tr><td class="paramname">lats</td><td>: returned array of latitudes </td></tr>
    <tr><td class="paramname">lons</td><td>: returned array of longitudes </td></tr>
    <tr><td class="paramname">values</td><td>: returned array of data values </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if OK, integer value on error </dd></dl>

</div>
</div>
<a class="anchor" id="ga3999693d3932a62eada0d1de5b594d2f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int codes_grib_iterator_delete </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcodes__iterator.html">codes_iterator</a> *&#160;</td>
          <td class="paramname"><em>i</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Frees an iterator from memory. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">i</td><td>: the iterator </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if OK, integer value on error </dd></dl>

</div>
</div>
<a class="anchor" id="ga97dfa89fe0ebed41b238d98bac36db8a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int codes_grib_iterator_has_next </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcodes__iterator.html">codes_iterator</a> *&#160;</td>
          <td class="paramname"><em>i</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Test procedure for values in an iterator. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">i</td><td>: the iterator </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>boolean, 1 if the iterator still nave next values, 0 otherwise </dd></dl>

</div>
</div>
<a class="anchor" id="ga250295a1b927401bcb1e03aac032396c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcodes__iterator.html">codes_iterator</a>* codes_grib_iterator_new </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcodes__handle.html">codes_handle</a> *&#160;</td>
          <td class="paramname"><em>h</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&#160;</td>
          <td class="paramname"><em>flags</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>error</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create a new iterator from a GRIB handle, using current geometry and values. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">h</td><td>: the handle from which the iterator will be created </td></tr>
    <tr><td class="paramname">flags</td><td>: flags for future use. </td></tr>
    <tr><td class="paramname">error</td><td>: error code </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the new iterator, NULL if no iterator can be created </dd></dl>

</div>
</div>
<a class="anchor" id="ga9bc83fc66d5f39ecf123d3c3e5b1fecf"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int codes_grib_iterator_next </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcodes__iterator.html">codes_iterator</a> *&#160;</td>
          <td class="paramname"><em>i</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>lat</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>lon</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the next value from an iterator. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">i</td><td>: the iterator </td></tr>
    <tr><td class="paramname">lat</td><td>: on output latitude in degree </td></tr>
    <tr><td class="paramname">lon</td><td>: on output longitude in degree </td></tr>
    <tr><td class="paramname">value</td><td>: on output value of the point </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>positive value if successful, 0 if no more data are available </dd></dl>

</div>
</div>
<a class="anchor" id="ga93ef62613c251baa5ada3924d3c856ac"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int codes_grib_iterator_previous </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcodes__iterator.html">codes_iterator</a> *&#160;</td>
          <td class="paramname"><em>i</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>lat</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>lon</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the previous value from an iterator. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">i</td><td>: the iterator </td></tr>
    <tr><td class="paramname">lat</td><td>: on output latitude in degree </td></tr>
    <tr><td class="paramname">lon</td><td>: on output longitude in degree </td></tr>
    <tr><td class="paramname">value</td><td>: on output value of the point* </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>positive value if successful, 0 if no more data are available </dd></dl>

</div>
</div>
<a class="anchor" id="ga635320df5854ae08367fed2e5f895e2b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int codes_grib_iterator_reset </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcodes__iterator.html">codes_iterator</a> *&#160;</td>
          <td class="paramname"><em>i</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Test procedure for values in an iterator. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">i</td><td>: the iterator </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if OK, integer value on error </dd></dl>

</div>
</div>
<a class="anchor" id="ga8c3b2ed99693a097211000552876a61d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int codes_grib_nearest_delete </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcodes__nearest.html">codes_nearest</a> *&#160;</td>
          <td class="paramname"><em>nearest</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Frees an nearest from memory. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">nearest</td><td>: the nearest </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if OK, integer value on error </dd></dl>

</div>
</div>
<a class="anchor" id="ga8c53c53033259beaf32055154f193a83"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int codes_grib_nearest_find </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcodes__nearest.html">codes_nearest</a> *&#160;</td>
          <td class="paramname"><em>nearest</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcodes__handle.html">codes_handle</a> *&#160;</td>
          <td class="paramname"><em>h</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>inlat</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>inlon</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&#160;</td>
          <td class="paramname"><em>flags</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>outlats</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>outlons</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>values</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>distances</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>indexes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Find the 4 nearest points of a latitude longitude point. </p>
<p>The flags are provided to speed up the process of searching. If you are sure that the point you are asking for is not changing from a call to another you can use CODES_NEAREST_SAME_POINT. The same is valid for the grid. Flags can be used together doing a bitwise OR. The distances are given in kilometres.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">nearest</td><td>: nearest structure </td></tr>
    <tr><td class="paramname">h</td><td>: handle from which geography and data values are taken </td></tr>
    <tr><td class="paramname">inlat</td><td>: latitude of the point to search for </td></tr>
    <tr><td class="paramname">inlon</td><td>: longitude of the point to search for </td></tr>
    <tr><td class="paramname">flags</td><td>: CODES_NEAREST_SAME_POINT, CODES_NEAREST_SAME_GRID </td></tr>
    <tr><td class="paramname">outlats</td><td>: returned array of latitudes of the nearest points </td></tr>
    <tr><td class="paramname">outlons</td><td>: returned array of longitudes of the nearest points </td></tr>
    <tr><td class="paramname">values</td><td>: returned array of data values of the nearest points </td></tr>
    <tr><td class="paramname">distances</td><td>: returned array of distances from the nearest points </td></tr>
    <tr><td class="paramname">indexes</td><td>: returned array of indexes of the nearest points </td></tr>
    <tr><td class="paramname">len</td><td>: size of the arrays </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if OK, integer value on error </dd></dl>

</div>
</div>
<a class="anchor" id="ga6338ab9e3fb68c25d4fe48a8467cdbfc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int codes_grib_nearest_find_multiple </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcodes__handle.html">codes_handle</a> *&#160;</td>
          <td class="paramname"><em>h</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>is_lsm</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>inlats</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>inlons</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>npoints</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>outlats</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>outlons</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>values</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>distances</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>indexes</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Find the nearest point of a set of points whose latitudes and longitudes are given in the inlats, inlons arrays respectively. </p>
<p>If the flag is_lsm is 1 the nearest land point is returned and the grib passed as handle (h) is considered a land sea mask. The land nearest point is the nearest point with land sea mask value&gt;=0.5. If no nearest land points are found the nearest value is returned. If the flag is_lsm is 0 the nearest point is returned. values, distances, indexes (in the "values" array) for the nearest points (ilons,ilats) are returned. The distances are given in kilometres.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">h</td><td>: handle from which geography and data values are taken </td></tr>
    <tr><td class="paramname">is_lsm</td><td>: lsm flag (1-&gt; nearest land, 0-&gt; nearest) </td></tr>
    <tr><td class="paramname">inlats</td><td>: latitudes of the points to search for </td></tr>
    <tr><td class="paramname">inlons</td><td>: longitudes of the points to search for </td></tr>
    <tr><td class="paramname">npoints</td><td>: number of points (size of the inlats,inlons,outlats,outlons,values,distances,indexes arrays) </td></tr>
    <tr><td class="paramname">outlats</td><td>: returned array of latitudes of the nearest points </td></tr>
    <tr><td class="paramname">outlons</td><td>: returned array of longitudes of the nearest points </td></tr>
    <tr><td class="paramname">values</td><td>: returned array of data values of the nearest points </td></tr>
    <tr><td class="paramname">distances</td><td>: returned array of distances from the nearest points </td></tr>
    <tr><td class="paramname">indexes</td><td>: returned array of indexes of the nearest points </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if OK, integer value on error </dd></dl>

</div>
</div>
<a class="anchor" id="ga201d49e6c835f3b6ed041147d0bf4898"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcodes__nearest.html">codes_nearest</a>* codes_grib_nearest_new </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcodes__handle.html">codes_handle</a> *&#160;</td>
          <td class="paramname"><em>h</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>error</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create a new nearest from a handle, using current geometry . </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">h</td><td>: the handle from which the iterator will be created </td></tr>
    <tr><td class="paramname">error</td><td>: error code </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the new nearest, NULL if no nearest can be created </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
